<template>
  <div id="intergral">
    <navigationBar></navigationBar>
    <!-- 下方最外层灰色盒子 -->
    <div class="container">
      <!--下方中间区域 -->
      <div class="section">
        <!-- 积分商城标题 -->
        <div class="integral_title">
          <img src="../../assets/image/3_0_icon_jifen.png" alt />
          <!-- 当前积分 -->
          <h3>
            当前积分:&nbsp;&nbsp;
            <span>{{ current_integral }}</span>
          </h3>
        </div>
        <!-- 积分商品展示卡片最外层盒子 -->
        <div class="integral_card">
          <!-- 每一项积分商品 -->
          <div
            class="item_card"
            v-for="(item, index) in item_card"
            :key="index"
            @click="toexchange()"
          >
            <!-- 商品图片 -->
            <img :src="item.imgurl" alt />
            <!-- 商品名称 -->
            <div class="goodsname">
              <span>{{ item.goodsname }}</span>
            </div>
            <!-- 此项商品的积分以及价格 -->
            <div class="item_bottom">
              <div class="integral">
                <span>{{ item.integral }}积分</span>
              </div>
              <div class="goodsprice">
                <span>市场价:&nbsp;￥{{ item.goodsprice }}</span>
              </div>
            </div>
          </div>
        </div>
        <!-- 底部分页栏 引入el-->
        <div class="pagination">
          <el-pagination
            background
            layout="prev, pager, next"
            :total="1000"
          ></el-pagination>
        </div>
      </div>
      <right></right>
      <foot></foot>
    </div>
  </div>
</template>

<script>
import navigationBar from "../../components/navigationBar";
import foot from "../../components/footer";
import right from "../../components/common/right_logo";
export default {
  components: {
    navigationBar,
    foot,
    right
  },
  data() {
    return {
      current_integral: 2000,
      item_card: [
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265hhhhhhhhhhhhhhhhhhhh...",
          integral: "300",
          goodsprice: "8.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "200",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "200",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "200",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "200",
          goodsprice: "10.5"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "400",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "400",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "400",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "400",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "400",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "400",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "400",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265...",
          integral: "400",
          goodsprice: "9.0"
        },
        {
          imgurl: "",
          goodsname: "正泰 微型断路器 DZ267-3265 qqqqqqqqqqqq...",
          integral: "400",
          goodsprice: "9.0"
        }
      ]
    };
  },
  methods: {
    //   跳转至积分商品兑换
    toexchange() {
      this.$router.push({
        path: "/exchangemall",
        name: "exchangemall"
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.container {
  width: 100%;
  background-color: rgb(238, 232, 232);
  padding-top: 20px;
  box-sizing: border-box;
  .section {
    margin: 0 auto;
    width: 1200px;
    background-color: #fff;
    margin-bottom: 40px;
    padding-bottom: 10px;
    .integral_title {
      display: flex;
      align-items: center;
      height: 52px;
      width: 100%;
      border-bottom: 1px solid rgba(230, 230, 230, 1);
      img {
        margin-left: 20px;
        margin-right: 10px;
      }
      h3 {
        font-size: 20px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        color: rgba(51, 51, 51, 1);
        span {
          // padding-top: 20px;
          color: #f03a58;
        }
      }
    }
    .integral_card {
      padding: 16px 16px 16px 22px;
      box-sizing: border-box;
      //   border: 1px solid red;
      min-height: 1500px;
      display: flex;
      justify-content: flex-start;
      flex-wrap: wrap;
      align-content: flex-start;

      .item_card {
        height: 340px;
        width: 280px;
        border: 1px solid rgba(219, 219, 219, 1);
        margin-right: 8px;
        margin-bottom: 12px;
        cursor: pointer;
        img {
          display: block;
          width: 100%;
          height: 260px;
          border: 1px solid red;
        }
        .goodsname {
          height: 22px;
          width: 100%;
          padding: 10px 8px;
          box-sizing: border-box;
          span {
            display: block;
            height: 22px;
            font-size: 18px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: rgba(62, 62, 62, 1);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }
        .item_bottom {
          height: 26px;
          width: 100%;
          display: flex;
          margin-top: 24px;
          padding: 0 10px;
          box-sizing: border-box;
          justify-content: space-between;
          align-items: center;
          .integral {
            span {
              font-size: 20px;
              font-family: Microsoft YaHei;
              font-weight: bold;
              color: rgba(240, 58, 88, 1);
            }
          }
          .goodsprice {
            span {
              font-size: 14px;
              font-family: Microsoft YaHei;
              font-weight: 400;
              color: rgba(153, 153, 153, 1);
            }
          }
        }
      }
    }
    .pagination {
      text-align: center;
      margin-top: -50px;
      margin-bottom: 20px;
    }
  }
}
// 统一修改el的默认样式
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  background: rgba(240, 58, 88, 1);
  color: #fff;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled):hover {
  font-size: 14px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: rgba(102, 102, 102, 1);
}
</style>
